package day240520.p2;

public class WithoutGenerics {
    private Object object;
    public void setObject(Object object){
        this.object=object;
    }

    public Object getObject() {
        return object;
    }

    public static void main(String[] args) {
        WithoutGenerics withoutGenerics=new WithoutGenerics();
        withoutGenerics.setObject("I am String");
        Object o=withoutGenerics.getObject();
//        System.out.println(o.length());
//        需要强制转换才能调用这个方法
        String os=(String)withoutGenerics.getObject();
        System.out.println(os.length());
    }
}
